#!/usr/bin/ruby

intervals = [
  [32, 64, 128, 136, 192, 200, 256, 264, 512, 520, 1032],
  [32, 64, 128, 136, 192, 200, 256, 264, 512, 520, 1032],
  [32, 64, 128, 136, 192, 200, 256, 264, 512, 520, 1032]
]

counter = -1

intervals[0].size.times do |x1|
  counter += 1
  File.open("flatarray_implementation_#{counter}.cu", "w") do |f|
    f.puts <<EOF
#include <iostream>
#include "cudalineupdatefunctorprototype.h"

EOF

    xA = intervals[0][x1]
    xB = xA

    intervals[1].size.times do |y1|
      yA = intervals[1][y1]
      yB = yA

      intervals[2].size.times do |z1|
        zA = intervals[2][z1]
        zB = zA

        f.puts "IMPLEMENTATION(CellLBM, #{xA}, #{yA}, #{zA}, #{xB}, #{yB}, #{zB})"
      end
    end
  end
end
